Video deblocking filter

ABSTRACT

Decomposition of deblocking filters used in block-based video compression allows reduction of computational redundancies.

BACKGROUND OF THE INVENTION

The present invention relates to video compression and decompression, and more particularly to filtering in block-based methods.

Digital video compression allows for practical (reduced bandwidth) realtime transmission of video without significant loss of quality. Many video compression standards have been developed beginning in the 1980s and include H.261, H.263, MPEG-1, MPEG-2, MPEG-4, and so forth. These standards generally use a block-based compression which includes motion compensation, block transform (e.g., DCT or wavelet) coding, and quantization. FIG. 2 illustrates a system with motion estimation (ME), motion compensation (MC), DCT, quantization (Q), inverse DCT (IDCT), and variable length coding (VLC) of the transmitted motion vectors and quantized DCT-transformed motion compensation residual.

H.264 is a new video compression video standard being developed by ITU-T. It offers much higher coding efficiency which provides about 30–50% additional bit-rate reduction at the same coding qualities as compared to the MPEG-4 SP. A typical application of H.264 could be wireless video on demand, in which the bandwidth is so limited that a coding standard of high compression ratio is strongly desired.

The basic coding techniques in H.264 are still the motion compensated prediction, transform, quantization and entropy coding. However, it differs from MPEG-4/H.263 in great detail. One of major differences lies in the transform and quantization. Instead of 8×8 DCT transforms, H.264 uses a 4×4 integer transforms for the residual coding (residual blocks are generated by using the motion compensation for inter-coded macroblocks, and using the intra prediction for intra-coded macroblocks).

As with all block-based compression methods, H.264 suffers from blockiness in the decompressed (reconstructed) video images. FIG. 3 illustrates the edges of blocks (4×4 blocks within 16×16 macroblocks) subject to deblocking filtering.

SUMMARY OF THE INVENTION

The present invention provides decomposition of a deblocking filter as used in H.264 and which reduces computational redundancy.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings are heuristic for clarity.

FIG. 1 is a flow diagram of preferred embodiment methods.

FIG. 2 shows motion compensation generally.

FIG. 3 illustrates edges for deblocking filtering.

FIG. 4 shows deblocking filter determination.

FIG. 5 shows pixel notation.

FIGS. 6 a–6 b are parameter tables.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

1. Overview

Preferred embodiment methods provide simplified deblocking filtering (as in H.264) by decomposition of the deblocking filter. This effectively creates intermediate values from pixel values being filtered and thereby reduces the redundancy in the deblocking filtering. FIG. 1 illustrates the overall flow.

Preferred embodiment communication systems, such as cellular spread spectrum systems, include preferred embodiment devices employing preferred embodiment deblocking filtering methods. The computations can be performed with digital signal processors (DSPs) or general-purpose programmable processors or application specific circuitry (ASICs) or systems on a chip such as both a DSP, ASIC, and RISC processor on the same chip with the RISC processor controlling. Analog-to-digital converters and digital-to-analog converters provide coupling to the real world, and modulators and demodulators (plus antennas for air interfaces) provide coupling for transmission waveforms.

2. First Preferred Embodiments

Initially, consider the following description of the deblocking filtering of H.264; the preferred embodiments will be implementations of the deblocking filtering.

H.264 requires a conditional filtering be applied to all macroblocks of a picture. This filtering is done on a macroblock basis, with macroblocks being processed in raster-scan order throughout the picture. For luma, as the first step, the 16 samples of the 4 vertical edges of the 4×4 raster shall be filtered beginning with the left edge, as shown in FIG. 3. Filtering of the 4 horizontal edges (vertical filtering) follows in the same manner, beginning with the top edge. The same ordering applies for chroma filtering, with the exception that 2 edges of 8 samples each are filtered in each direction. This process also affects the boundaries of the already reconstructed macroblocks above and to the left of the current macroblock. Picture edges are not filtered.

When mb_adaptive_frame_field_flag=1, a MB may be coded in frame or field decoding mode. For frame MB, deblocking is performed on the frame samples. In this case, if neighboring MB pairs are field MBs, they shall be converted into frame MB pairs before deblocking. For field MB, deblocking is performed on the field samples of the same field parity. In this case, if neighboring MB pairs are frame MBs, they shall be converted into field MB pairs before deblocking.

Intra prediction of a macroblock shall be done using the unfiltered content of the already decoded neighboring macroblocks. Depending on the implementation, the values necessary for intra prediction may need to be stored before filtering in order to be used in the intra prediction of the macroblocks to the right and below the current macroblock.

When pic_structure indicates a field picture all decoding operations for the deblocking filter are based solely on samples within the current field.

For each boundary between neighboring 4×4 luma blocks, a “Boundary Strength” Bs is assigned as shown by the process of FIG. 4. If Bs=0, filtering is skipped for that particular edge. In all other cases filtering is dependent on the local sample properties and the value of Bs for this particular boundary segment.

For each edge, if one of the neighboring blocks is intra-coded, a relatively strong filtering (Bs=3) is applied. A special procedure with even stronger filtering might be applied on intra-coded macroblock boundaries (Bs=4). If neither of the blocks are intra-coded and at least one of them contains non-zero coefficients, medium filtering strength (Bs=2) is used. If none of the previous conditions are satisfied, filtering takes place with Bs=1 if at least one of the following conditions is satisfied: (a) prediction of the two blocks is formed using different reference frames or a different number of reference frames. (b) a pair of motion vectors from the two blocks is referencing the same frame and either component of this pair has a difference of more than one sample. Otherwise filtering is skipped for that particular edge (Bs=0).

In the following description, the set of eight samples across a 4×4 block horizontal or vertical boundary is denoted as shown in FIG. 5 with the actual boundary lying between p₀ and q₀. Uppercase letters indicate filtered samples and lower case letters indicate unfiltered samples with regard to the current edge filtering operation. However, p₁ and p₂ may indicate samples that have been modified by the filtering of a previous block edge.

Sets of samples across this edge are filtered only if the condition Bs≠0 && |p ₀ −q ₀|<α && |p ₁ −p ₀|<β && |q ₁ −q ₀|<β is true. The values of the thresholds α and β are dependent on the average value of QP (quantization parameter) for the two blocks as well as on a pair of index offsets “Filter_Offset_A” and “Filter_Offset_B” that may be transmitted in the slice header for the purpose of modifying the characteristics of the filter. The average QP value for the two blocks is computed as QP_(av)=(QP_(p)+QP_(q))>>1. The index used to access the α-table (FIG. 6 a), as well as the C0-table (FIG. 6 b) that is used in the default filter mode, is computed as: Index_(A)=Clip3(0, 51, QP _(av)+Filter_Offset_(—) A) In SP and SI slices, QP_(av) is calculated in the same way as in other slice types; QS_(Y) is not used in the deblocking filter.

The index used to access the β-table (FIG. 6 a) is computed as: Index_(B)=Clip3(0, 51, QP _(av)+Filter_Offset_(—) B)

Two types of filtering are defined for 0<Bs<4. The default case applies the following to filter p₀ and q₀: Δ=Clip3(−C, C, (((q ₀ −p ₀)<<2+(p ₁ −q ₁)+4)>>3)) P ₀=Clip1(p ₀+Δ) Q ₀=Clip1(q ₀−Δ) where C is determined as specified below. Note that the “+4” together with the right shift in the definition of Δ provides a round-off.

The two intermediate threshold variables α_(p) =|p ₂ −p ₀| α _(q) =|q ₂ −q ₀| shall be used to determine whether filtering for the luma samples p₁ and q₁ is taking place at this position of the edge.

If α_(p)<β for a luma edge, a filtered sample P₁ shall be produced as specified by P ₁ =p ₁+Clip3(−C0, C0, (p ₂+(p ₀ +q ₀)>>1−(p ₁<<1)>>1)

If α_(q)<β for a luma edge, a filtered sample Q₁ shall be produced as specified by Q ₁ =q ₁+Clip3(−C0, C0, (q ₂+(p ₀ +q ₀)>>1−(q ₁<<1)>>1) where C0 is specified in FIG. 6 b. Chroma samples p₁ and q₁ are never filtered. C is determined by setting it equal to C0 and then incrementing it by one if α_(p)<β, and again by one if α_(q)<β.

When Bs is equal to 4 and the following condition holds: α_(p)<β && |p ₀ −q ₀|<((α>>2)+2) filtering of the left/upper side of the block edge is specified by the following two filters: P ₀=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3 P ₁=(p ₂ +p ₁ +p ₀ +q ₀+2)>>2 In the case of luma filtering, the following filter is also applied. P ₂=(2*p ₃+3*p ₂ +p ₁ +p ₀ +q ₀+4)>>3 Otherwise, if the foregoing condition does not hold but Bs equals 4, the following filter is applied. P ₀=(2*p ₁ +p ₀ +q ₁+2)>>2

Similarly, for filtering of the right/lower side of the edge, if the following condition holds: α_(q)<β && |p ₀ −q ₀|<((α>>2)+2) filtering is defined by the following two filters: Q ₀=(p ₁+2*p ₀+2*q ₀+2*q ₁ +q ₂+4)>>3 Q ₁=(p ₀ +q ₀ +q ₁ +q ₂+2)>>2 In the case of luma filtering, the following filter is also applied. Q ₂=(2*q ₃+3*q ₂ +q ₁ +q ₀ +p ₀+4)>>3 Otherwise, if the condition does not hold, the following filter is applied: Q ₀=(2*q ₁ +q ₀ +p ₁+2)>>2

The first preferred embodiment methods implement the filterings for the Bs equals 4 case by decomposition of the filters (creating intermediate values) as follows.

Define u ₀ =p ₃ +p ₂ u ₁ =p ₂ +p ₁ u ₂ =p ₁ +p ₀+2 u ₃ =p ₀ +q ₀+2 u ₄ =q ₀ +q ₁ u ₅ =q ₁ +q ₂ u ₆ =q ₂ +q ₃ and then define: t ₀ =u ₀ +u ₁ t ₁ =u ₁ +u ₂ t ₂ =u ₂ +u ₃ t ₃ =u ₃ +u ₄ t ₄ =u ₄ +u ₅ t ₅ =u ₅ +u ₆ Thus the filtering from p_(k), q_(k) to u_(k) is simply a [1,1] filter plus the addition of round-off 2s, and the filtering from the u_(k) to the t_(k) is another filtering by [1,1]. Then the Bs=4 deblocking filtering is implemented as: P ₀=(t ₁ +t ₃)>>3 Q ₀=(t ₂ +t ₄)>>3 P ₁=(u ₁ +U ₃)>>2 Q ₁=(u ₃ +u ₅)>>2 P ₂=(t ₀ +u ₀ +u ₃+2)>>3 Q ₂=(t ₅ +u ₆ +U ₃+2)>>3 Note that the direct implementation of the filter to give P₀, Q₀, is a [1,2,2,2,1]/8 filter, and the first preferred embodiment method effectively decomposes the filter into [1,1]/2*[1,1]/2*[1,0,1]/2. This reduces computational redundancy: the preferred embodiment method requires 19 adds and 4 shifts to compute P₀, Q₀, P₁, Q₁, and another 6 adds and 2 shifts to compute P₂ and Q₂. This compares with a direct implementation of the filterings which requires 18 adds and 10 shifts to compute P₀, Q₀, P₁, Q₁, and another 12 adds and 6 shifts to compute P₂ and Q₂, assuming multiplications are implemented with shifts. As a further comparison, a DSP with a single-cycle MAC (multiply and accumulate) would require 18 MACs and 4 shifts for P₀, Q₀, P₁, Q₁, and another 10 MACs and 2 shifts for P₂ and Q₂.

Futher, the round-off additions may be moved to modify the intermediate values and computations; for example:

Define u ₀ =p ₃ +p ₂ u ₁ =p ₂ +p ₁ u ₂ =p ₁ +p ₀ u ₃ =p ₀ +q ₀+4 u ₄ =q ₀ +q ₁ u ₅ =q ₁ +q ₂ u ₆ =q ₂ +q ₃ and then define: t ₀ =u ₀ +u ₁ t ₁ =u ₁ +u ₂ t ₂ =u ₂ +u ₃ t ₃ =u ₃ +u ₄ t ₄ =u ₄ +u ₅ t ₅ =u ₅ +u ₆ The deblocking filtering is now implemented as: P ₀=(t ₁ +t ₃)>>3 Q ₀=(t ₂ +t ₄)>>3 P ₁=(u ₁ +u ₃−2)>>2 Q ₁=(u ₃ +u ₅−2)>>2 P ₂=(t ₀ +u ₀ +u ₃)>>3 Q ₂=(t ₅ +u ₆ +u ₃)>>3 Similarly, the placement of the round-off addition(s) may be varied in other patterns.

The preferred embodiment filter decomposition similarly applies when either of the conditions α_(p)<β && |p₀−q₀|<((α>>2)+2) or a_(q)<β && |p₀−q₀|<((α>>2)+2) does not hold but Bs=4 and one or both of the simpler p₀ or q₀ filters are applied: P ₀=(2*p ₁ +p ₀ +q ₁+2)>>2 Q ₀=(2*q ₁ +q ₀ +p ₁+2)>>2 In particular, the preferred embodiment filter decomposition for this case is: w ₀ =p ₁ +q ₁+2 w _(p) =p ₀ +p ₁ w _(q) =q ₀ +q ₁ P ₀=(w ₀ +w _(p))>>2 Q ₀=(w ₀ +w _(q))>>2 Thus the total of 6 adds and 2 shifts for the decomposed filter replaces the direct filter 6 adds and 4 shifts (presuming implementation of a multiplication by 2 as a shift) or 6 MACs and 2 shifts. Of course, because w_(p) and w_(q) are only used once, they could be replaced by their definitions in P₀ and Q₀ without changing the number of adds and shifts. 3. Alternative Preferred Embodiments

Further preferred embodiments decompose the Bs=4 filterings in alternative ways in order to remove computational redundancies. For example, define w ₀ =p ₀ +q ₀+2 w ₁ =p ₁ +q ₁ w _(2p) =p ₂ +p ₁ w _(2q) =q ₂ +q ₁ w _(3p) =p ₃ +p ₂ w _(3q) =q ₃ +q ₂ and then define: t ₀ =w ₀ +w ₁ t _(p) =w _(2p) +w ₀ t _(q) =w _(2q) +w ₀ Thus P ₀=(t _(p) +t ₀)>>3 Q ₀=(t _(q) +t ₀)>>3 P ₁ =t _(p)>>2 Q ₁=t_(q)>>2 P ₂=(2*w _(3p) +t _(p)+2)>>3 Q ₂=(2*W _(3q) +t _(q)+2)>>3 Thus this implementation requires 12 adds and 4 shifts to compute P₀, Q₀, P₁, Q₁, and another 4 adds and 4 shifts to compute P₂ and Q₂, assuming the multiplications by 2 are implemented with shifts.

Again, the round-off additions can be reallocated, such as by the “+2” in P₂ could become a “+1” in the definition of w_(3p), and so forth.

4. Modifications

The preferred embodiment methods may be modified in many ways while retaining the feature of decomposition of deblocking filters.

For example, if the P_(k) and Q_(k) filters differ, then only the necessary portion of the decomposition intermediate values are computed. 

1. A method of deblocking filtering, comprising: (a) providing adjacent first and second macroblocks in an image; (b) finding deblocking filters for said macroblocks; (c) decomposing ones of said deblocking filters which combine 8 pixel values (counting repeats) into three stages with a first stage combining pairs of said pixel values to yield first-stage intermediate values, a second stage combining pairs of said first-stage intermediate values to yield second-stage intermediate values, and a third stage combining values from the group consisting of said pixel values, said first-stage intermediate values, and said second-stage intermediate values; and (d) applying said deblocking filters including any decomposition from step (c) to said macroblocks.
 2. The method of claim 1, wherein: (a) ones of said deblocking filters which combine 4 pixel values (counting repeats) combine values from the group consisting of said first-stage intermediate values.
 3. The method of claim 1, wherein: (a) ones of said deblocking filters which combine 4 pixel values (counting repeats) use values from the group consisting of said second-stage intermediate values.
 4. The method of claim 1, wherein: (a) said combining of pairs of pixel values of step (c) is selected from the group of operations consisting of (i) addition of a pair of pixel values and (ii) addition of a pair of pixel values plus addition of a round-off term. 